package com.itheima.controller;

import com.itheima.entity.Dish;
import com.itheima.jsonresult.JsonResult;
import com.itheima.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author linying
 * @since 2022-10-13
 */
@RestController
@RequestMapping("/dish")
public class DishController {

    @Autowired
    private DishService dishService;

    /**
     * 菜品列表
     * @param categoryId
     * @param status
     * @return
     */
    @GetMapping("/list")
    public JsonResult dishListclient(String categoryId,String status) {
        List<Dish> list = dishService.dishListclient(categoryId, status);

        return JsonResult.success(list);
    }



}
